import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import path from "path";
import WindiCSS from "vite-plugin-windicss";

// https://vite.dev/config/
export default defineConfig({
  base: "./",
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "src"),
    },
  },
  server: {
    port: 8080,
    host: true,
    open: true,
    proxy: {
      "/api": {
        target: "http://23.210.23.12:4416", //开发环境地址
        // target: "https://221.178.97.195:8081",
        // target: "https://szjy.cqedu.cn:8081",
        changeOrigin: true,
        rewrite: (p) => p.replace(/^\/api/, ""),
      },
    },
  },
  plugins: [vue(), WindiCSS()],
});
